#pragma once
#include <chrono>
#include <functional>
#include <random>
#include <vector>

#define VarToStr(A) #A
namespace HelperFunction
{
    class RandomSeriesGenerator
    {
    public:
        static std::vector<int> SpawnData(int min=0, int max=100)
        {
            engine.seed(std::chrono::system_clock::now().time_since_epoch().count());
            std::uniform_int_distribution<int>und(0, 100);
            size_t s = und(engine);
            for (size_t i = 0; i < s; i++)
            {
                series.push_back(und(engine));
            }
            return series; 
        }
    private:
        static std::default_random_engine engine;
        static std::vector<int>series;
    };

    inline bool IsAlgorithmRight(std::function<void(std::vector<int>&,bool(*)(int,int))>func,bool(*f)(int,int))
    {
        int i = 50;
        while (i)
        {
            std::vector<int> vec = RandomSeriesGenerator::SpawnData();
            std::vector<int> vec1(vec);
            std::sort(vec.begin(), vec.end(),f);
            func(vec1,f);
            if (vec != vec1)
            {
                for(int i = 0;i<vec.size();i++)
                {
                    if(vec[i]!=vec1[i])
                    {
                        return false;
                    }
                }
                return false;
            }
            i--;
        }
        return true;
    }
    inline bool PositiveSequence(int lhs,int rhs)
    {
        if(lhs<rhs)
        {
            return true;
        }
        return false;
    }
    inline bool ReverseSequence(int lhs,int rhs)
    {
        if(lhs>rhs)
        {
            return true;
        }
        return false;
    }
}            
